package ru.averta.notes.domain;

import ru.averta.notes.domain.abstr.AbstractPersistentObject;

import javax.persistence.*;
import java.util.Collection;

/**
 * <code>Url</code>
 *
 * @author fedor.belov (fedor.belov@mail.ru)
 *         Date: 26.09.11 16:45
 */

@Entity
public class Url extends AbstractPersistentObject {

    public Url(String url) {
        this.url = url;
    }

    public Url() {
    }

    @Column
    private String url;

    @ManyToMany(fetch = FetchType.LAZY, mappedBy = "urls")
    private Collection<GoogleSuggest> suggests;

    @OneToMany(fetch = FetchType.LAZY, mappedBy="url")
    private Collection<Site> sites;

    public String getUrl() {
        return url;
    }
}
